From 5dbc9ae560144fa63471e21bfdf549d2f45bcadc Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Tue, 15 Mar 2005 23:27:30 +0000 Subject: [PATCH] bitkeeper revision 1.1236.31.3 (42376f62DcjuC-_BFPp328kWnfyo1w) Fix uninitialized variable causing early NaT fault --- .rootkeys | 1 + xen/arch/ia64/domain.c | 1 + xen/arch/ia64/process.c | 5 ++- xen/arch/ia64/tools/README.xenia64linux | 50 +++++++++++++++++++++++++ xen/arch/ia64/vcpu.c | 27 ++++++++++++- xen/arch/ia64/xenmisc.c | 2 + xen/include/asm-ia64/config.h | 3 +- 7 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 xen/arch/ia64/tools/README.xenia64linux diff --git a/.rootkeys b/.rootkeys index 2986ce0696..169081eaca 100644 --- a/.rootkeys +++ b/.rootkeys @@ -945,6 +945,7 @@ 421098b69pUiIJrqu_w0JMUnZ2uc2A xen/arch/ia64/smp.c 421098b6_ToSGrf6Pk1Uwg5aMAIBxg xen/arch/ia64/smpboot.c 421098b6AUdbxR3wyn1ATcmNuTao_Q xen/arch/ia64/tools/README.xenia64 +42376c6dfyY0eq8MS2dK3BW2rFuEGg xen/arch/ia64/tools/README.xenia64linux 421098b6rQ2BQ103qu1n1HNofbS2Og xen/arch/ia64/tools/mkbuildtree 41a26ebc--sjlYZQxmIxyCx3jw70qA xen/arch/ia64/vcpu.c 421098b6M2WhsJ_ZMzFamAQcdc5gzw xen/arch/ia64/vhpt.c diff --git a/xen/arch/ia64/domain.c b/xen/arch/ia64/domain.c index 82fe694e88..b070541751 100644 --- a/xen/arch/ia64/domain.c +++ b/xen/arch/ia64/domain.c @@ -248,6 +248,7 @@ void new_thread(struct exec_domain *ed, regs->pr = 0; sw->pr = 0; regs->ar_pfs = 0; + sw->caller_unat = 0; sw->ar_pfs = 0; sw->ar_bspstore = new_rbs; //regs->r13 = (unsigned long) ed; diff --git a/xen/arch/ia64/process.c b/xen/arch/ia64/process.c index 08fd4d0c54..c2148c4662 100644 --- a/xen/arch/ia64/process.c +++ b/xen/arch/ia64/process.c @@ -204,10 +204,11 @@ void deliver_pending_interrupt(struct pt_regs *regs) struct exec_domain *ed = current; // FIXME: Will this work properly if doing an RFI??? if (!is_idle_task(d) && user_mode(regs)) { - vcpu_poke_timer(ed); + //vcpu_poke_timer(ed); if (vcpu_deliverable_interrupts(ed)) { unsigned long isr = regs->cr_ipsr & IA64_PSR_RI; - foodpi(); + if (vcpu_timer_pending_early(ed)) +printf("*#*#*#* about to deliver early timer to domain %d!!!\n",ed->domain->id); reflect_interruption(0,isr,0,regs,IA64_EXTINT_VECTOR); } } diff --git a/xen/arch/ia64/tools/README.xenia64linux b/xen/arch/ia64/tools/README.xenia64linux new file mode 100644 index 0000000000..ab694423b5 --- /dev/null +++ b/xen/arch/ia64/tools/README.xenia64linux @@ -0,0 +1,50 @@ +INSTRUCTIONS FOR BUILDING XENLINUX/IA64 + +1) In linux-2.6.9: (also tested with 2.6.10, 2.6.11.2) + cp arch/ia64/configs/zx1_defconfig .config +2) vi .config + unset CONFIG_IA32_SUPPORT + unset CONFIG_IDE [for now, need to fix later] + unset CONFIG_VIRTUAL_MEM_MAP [for now, need to fix later] + set CONFIG_DISABLE_VHPT +3) if running on ski, it is useful to make the following change: + a) at the beginning of drivers/acpi/motherboard.c:acpi_reserve_resources() + add the line: + if (!acpi_gbl_FADT) return; +4) Build linux. + a) yes "" | make oldconfig + b) check the resulting .config to ensure there are no modules used (because + Xen/ia64 doesn't support them yet). Change '=m' to '=n' and remake + c) yes "" | make oldconfig + d) make +5) Linux must be "privified" to run on Xen/ia64. This process converts all + privilege-sensitive instructions into privileged instructions. + Usage: privify infile outfile + Privify is very dumb... it will not overwrite outfile. It also prints + out a bunch of useless info that can be safely ignored (except for "panic"). + The privify program can be obtained from: + ftp://ftp.hpl.hp.com/pub/xen-ia64/privify +6) debug fixes: + a) periodically xenlinux/ia64 goes into a fit of printing + "Oops: timer tick before it is due..." This can be changed + in arch/ia64/kernel/time.c to either ignore it or print something + shorter + b) The hp simulator (ski) console drivers can be turned on to allow + output of early boot information from xenlinux. This results + in some duplication of later output (which can be ignored). + i) in linux/arch/ia64/Makefile, force the sim drivers by changing + drivers-$(CONFIG_IA64_HP_SIM) += arch/ia64/hp/sim to + drivers-y += arch/ia64/hp/sim + ii) in linux/arch/ia64/hp/sim/Makefile, force the sim drivers + by changing obj-$(CONFIG_HP_SIMSERIAL) to obj-y and + obj-$(CONFIG_HP_SIM_SERIAL_CONSOLE) to obj-y + iii) in arch/ia64/kernel/setup.c:early_console_setup(), replace + the contents of the routine with: + extern struct console hpsim_cons; + register_console(&hpsim_cons); + return 0; + (It may be necessary also to un-inline the routine, not sure.) + c) It can be useful to modify linux/init/main.c to add a printf before + or after a lot of the init calls +6) NOTE: mca currently has a problem with binary translation, + must run with "nomca" as a kernel argument diff --git a/xen/arch/ia64/vcpu.c b/xen/arch/ia64/vcpu.c index c0ab341b82..f37aa1ab27 100644 --- a/xen/arch/ia64/vcpu.c +++ b/xen/arch/ia64/vcpu.c @@ -572,6 +572,12 @@ UINT64 vcpu_deliverable_interrupts(VCPU *vcpu) vcpu_check_pending_interrupts(vcpu) != SPURIOUS_VECTOR); } +UINT64 vcpu_deliverable_timer(VCPU *vcpu) +{ + return (vcpu_get_psr_i(vcpu) && + vcpu_check_pending_interrupts(vcpu) == PSCB(vcpu,itv)); +} + IA64FAULT vcpu_get_lid(VCPU *vcpu, UINT64 *pval) { extern unsigned long privop_trace; @@ -950,9 +956,28 @@ void vcpu_pend_timer(VCPU *vcpu) UINT64 itv = PSCB(vcpu,itv) & 0xff; if (vcpu_timer_disabled(vcpu)) return; +#if 1 + // attempt to flag "timer tick before its due" source + { + UINT64 itm = PSCB(vcpu,domain_itm); + UINT64 now = ia64_get_itc(); + if (now < itm) printf("******* vcpu_pend_timer: pending before due!\n"); + } +#endif vcpu_pend_interrupt(vcpu, itv); } +// returns true if ready to deliver a timer interrupt too early +UINT64 vcpu_timer_pending_early(VCPU *vcpu) +{ + UINT64 now = ia64_get_itc(); + UINT64 itm = PSCB(vcpu,domain_itm); + + if (vcpu_timer_disabled(vcpu)) return 0; + if (!itm) return 0; + return (vcpu_deliverable_timer(vcpu) && (now < itm)); +} + //FIXME: This is a hack because everything dies if a timer tick is lost void vcpu_poke_timer(VCPU *vcpu) { @@ -974,7 +999,7 @@ void vcpu_poke_timer(VCPU *vcpu) if (irr & (1L<<(0xef-0xc0))) return; if (now-itm>0x800000) printf("*** poking timer: now=%lx,vitm=%lx,xitm=%lx,itm=%lx\n",now,itm,local_cpu_data->itm_next,ia64_get_itm()); - vcpu_pend_interrupt(vcpu, 0xefL); + vcpu_pend_timer(vcpu); } } } diff --git a/xen/arch/ia64/xenmisc.c b/xen/arch/ia64/xenmisc.c index 7f215470a8..fe4de437e2 100644 --- a/xen/arch/ia64/xenmisc.c +++ b/xen/arch/ia64/xenmisc.c @@ -257,6 +257,7 @@ void context_switch(struct exec_domain *prev, struct exec_domain *next) //if (!is_idle_task(next->domain) ) //send_guest_virq(next, VIRQ_TIMER); load_region_regs(current); + if (vcpu_timer_expired(current)) vcpu_pend_timer(current); } void panic_domain(struct pt_regs *regs, const char *fmt, ...) @@ -276,5 +277,6 @@ void panic_domain(struct pt_regs *regs, const char *fmt, ...) printf(buf); if (regs) show_registers(regs); domain_pause_by_systemcontroller(current->domain); + set_bit(DF_CRASHED, ed->domain->d_flags); //while(test); } diff --git a/xen/include/asm-ia64/config.h b/xen/include/asm-ia64/config.h index d7d29fd454..ed6568bc09 100644 --- a/xen/include/asm-ia64/config.h +++ b/xen/include/asm-ia64/config.h @@ -1,7 +1,6 @@ // control flags for turning on/off features under test #undef CLONE_DOMAIN0 -//#define CLONE_DOMAIN0 3 -#define USER_ACCESS +//#define CLONE_DOMAIN0 1 // manufactured from component pieces -- 2.30.2